package com.example.chapter0703;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {
    private Button button;
    private EditText etFirst,etSecond;
    public static final String STRING_2 = "s22211";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        button = findViewById(R.id.button);
        etFirst = findViewById(R.id.et_first);
        etSecond = findViewById(R.id.et_second);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String s1 = etFirst.getText().toString();
                String s2 = etSecond.getText().toString();
                Intent intent = new Intent(MainActivity.this,SecondActivity.class);
                intent.putExtra("s1",s1);
                intent.putExtra(STRING_2,s2);
                startActivity(intent);
            }
        });
    }
}